#pragma once
#include "AST.h"
#include <iostream>
#include "SymbolTable.h"
#include "Module.h"
#include "BasicBlock.h"

using std::cout;
using std::endl;

void visitInitVarDef(ASTNode *ctx, SymbolTable *s, Module *m, BasicBlock* bb, bool isGlobal, bool isConst);


void process_funcFParams(ASTNode* node, vector<pair<string, string>> &paramNames);
void process_blockItem(ASTNode* node, SymbolTable* s, Module* m, BasicBlock* bb);
void process_decl(ASTNode* node, SymbolTable* s, Module* m, BasicBlock* bb);
void process_stmt(ASTNode* node, SymbolTable* s, Module* m, BasicBlock* bb);
void process_exp(ASTNode* node, SymbolTable* s, Module* m, BasicBlock* bb);
void process_return(ASTNode* node, SymbolTable* s, Module* m, BasicBlock* bb);


void visitBType(ASTNode *ctx, string &type);
void visitIdent(ASTNode *ctx, string &var_name);
void visitNumber(ASTNode *ctx, variant<int, string> &data);